﻿namespace QLBanHang.UC
{
    using DevExpress.Data;
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Mask;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Base;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTab;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    public class ucbn_dsbncho : XtraUserControl
    {
        private long _idql;
        private int _iloaids;
        private IContainer components;
        private DateEdit datedenngay;
        private DateEdit datetungay;
        private GridControl gridds;
        private GridColumn gridds_diachi;
        private GridColumn gridds_gioitinh;
        private GridColumn gridds_id;
        private GridColumn gridds_ma;
        private GridColumn gridds_namsinh;
        private GridColumn gridds_ngay;
        private GridColumn gridds_stt;
        private GridColumn gridds_ten;
        private GridColumn gridds_tenphong;
        private GridView gridView1;
        private GroupControl groupds;
        private Label label1;
        private Label label12;
        private Label label2;
        private LookUpEdit lkephong;
        private RepositoryItemTextEdit repositoryItemTextEdit1;
        private RepositoryItemTextEdit repositoryItemTextEdit2;
        private SimpleButton sbtnketthuc;
        private SimpleButton sbtntim;

        public ucbn_dsbncho()
        {
            this._idql = 0L;
            this._iloaids = 1;
            this.components = null;
            this.InitializeComponent();
        }

        public ucbn_dsbncho(int loaids)
        {
            this._idql = 0L;
            this._iloaids = 1;
            this.components = null;
            this.InitializeComponent();
            this._iloaids = loaids;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                int[] selectedRows = this.gridView1.GetSelectedRows();
                string s = this.gridView1.GetRowCellValue(selectedRows[0], this.gridds_id).ToString();
                this._idql = long.Parse(s);
                this.sbtnketthuc_Click(null, null);
            }
            catch
            {
            }
        }

        private void gridView1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                this.gridView1_DoubleClick(null, null);
            }
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(ucbn_dsbncho));
            StyleFormatCondition condition = new StyleFormatCondition();
            this.groupds = new GroupControl();
            this.lkephong = new LookUpEdit();
            this.sbtnketthuc = new SimpleButton();
            this.gridds = new GridControl();
            this.gridView1 = new GridView();
            this.gridds_ngay = new GridColumn();
            this.gridds_stt = new GridColumn();
            this.gridds_tenphong = new GridColumn();
            this.gridds_ma = new GridColumn();
            this.repositoryItemTextEdit1 = new RepositoryItemTextEdit();
            this.gridds_ten = new GridColumn();
            this.gridds_id = new GridColumn();
            this.gridds_gioitinh = new GridColumn();
            this.gridds_namsinh = new GridColumn();
            this.gridds_diachi = new GridColumn();
            this.repositoryItemTextEdit2 = new RepositoryItemTextEdit();
            this.sbtntim = new SimpleButton();
            this.datedenngay = new DateEdit();
            this.label2 = new Label();
            this.label1 = new Label();
            this.datetungay = new DateEdit();
            this.label12 = new Label();
            this.groupds.BeginInit();
            this.groupds.SuspendLayout();
            this.lkephong.Properties.BeginInit();
            this.gridds.BeginInit();
            this.gridView1.BeginInit();
            this.repositoryItemTextEdit1.BeginInit();
            this.repositoryItemTextEdit2.BeginInit();
            this.datedenngay.Properties.VistaTimeProperties.BeginInit();
            this.datedenngay.Properties.BeginInit();
            this.datetungay.Properties.VistaTimeProperties.BeginInit();
            this.datetungay.Properties.BeginInit();
            base.SuspendLayout();
            this.groupds.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.groupds.AppearanceCaption.Font = new Font("Tahoma", 10f, FontStyle.Bold);
            this.groupds.AppearanceCaption.Options.UseFont = true;
            this.groupds.Controls.Add(this.lkephong);
            this.groupds.Controls.Add(this.sbtnketthuc);
            this.groupds.Controls.Add(this.gridds);
            this.groupds.Controls.Add(this.sbtntim);
            this.groupds.Controls.Add(this.datedenngay);
            this.groupds.Controls.Add(this.label2);
            this.groupds.Controls.Add(this.label1);
            this.groupds.Controls.Add(this.datetungay);
            this.groupds.Controls.Add(this.label12);
            this.groupds.Location = new Point(3, 3);
            this.groupds.Name = "groupds";
            this.groupds.Size = new Size(0x341, 0x1cb);
            this.groupds.TabIndex = 0;
            this.groupds.Text = "Danh s\x00e1ch bệnh nh\x00e2n chờ kh\x00e1m bệnh";
            this.lkephong.Location = new Point(0x1bd, 0x1a);
            this.lkephong.Name = "lkephong";
            this.lkephong.Properties.Appearance.Font = new Font("Tahoma", 10f);
            this.lkephong.Properties.Appearance.Options.UseFont = true;
            this.lkephong.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.lkephong.Properties.Columns.AddRange(new LookUpColumnInfo[] { new LookUpColumnInfo("id", "id", 20, FormatType.None, "", false, HorzAlignment.Default), new LookUpColumnInfo("ten", "T\x00ean") });
            this.lkephong.Properties.NullText = "";
            this.lkephong.Size = new Size(0xb5, 0x16);
            this.lkephong.TabIndex = 4;
            this.lkephong.EditValueChanged += new EventHandler(this.lkephong_EditValueChanged);
            this.sbtnketthuc.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.sbtnketthuc.Appearance.Font = new Font("Tahoma", 10f);
            this.sbtnketthuc.Appearance.Options.UseFont = true;
            this.sbtnketthuc.Image = (Image) manager.GetObject("sbtnketthuc.Image");
            this.sbtnketthuc.ImeMode = ImeMode.NoControl;
            this.sbtnketthuc.Location = new Point(0x2dc, 0x1a);
            this.sbtnketthuc.Name = "sbtnketthuc";
            this.sbtnketthuc.Size = new Size(0x60, 0x17);
            this.sbtnketthuc.TabIndex = 5;
            this.sbtnketthuc.Text = "&Đ\x00f3ng [F12]";
            this.sbtnketthuc.Click += new EventHandler(this.sbtnketthuc_Click);
            this.gridds.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.gridds.Location = new Point(5, 0x38);
            this.gridds.MainView = this.gridView1;
            this.gridds.Name = "gridds";
            this.gridds.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemTextEdit1, this.repositoryItemTextEdit2 });
            this.gridds.Size = new Size(0x337, 0x18e);
            this.gridds.TabIndex = 0;
            this.gridds.ViewCollection.AddRange(new BaseView[] { this.gridView1 });
            this.gridView1.Appearance.ColumnFilterButton.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.ColumnFilterButton.BorderColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.ColumnFilterButton.ForeColor = Color.Black;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseBackColor = true;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.ColumnFilterButton.Options.UseForeColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.BackColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView1.Appearance.ColumnFilterButtonActive.BorderColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView1.Appearance.ColumnFilterButtonActive.ForeColor = Color.Black;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBackColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBorderColor = true;
            this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseForeColor = true;
            this.gridView1.Appearance.Empty.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.Empty.BackColor2 = Color.White;
            this.gridView1.Appearance.Empty.Options.UseBackColor = true;
            this.gridView1.Appearance.EvenRow.BackColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView1.Appearance.EvenRow.BorderColor = Color.FromArgb(0xdd, 0xe7, 0xea);
            this.gridView1.Appearance.EvenRow.ForeColor = Color.Black;
            this.gridView1.Appearance.EvenRow.Options.UseBackColor = true;
            this.gridView1.Appearance.EvenRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.EvenRow.Options.UseForeColor = true;
            this.gridView1.Appearance.FilterCloseButton.BackColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView1.Appearance.FilterCloseButton.BorderColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView1.Appearance.FilterCloseButton.ForeColor = Color.Black;
            this.gridView1.Appearance.FilterCloseButton.Options.UseBackColor = true;
            this.gridView1.Appearance.FilterCloseButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.FilterCloseButton.Options.UseForeColor = true;
            this.gridView1.Appearance.FilterPanel.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.FilterPanel.BackColor2 = Color.White;
            this.gridView1.Appearance.FilterPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.FilterPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.FilterPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.FixedLine.BackColor = Color.FromArgb(0x7a, 0x72, 0x71);
            this.gridView1.Appearance.FixedLine.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedCell.BackColor = Color.White;
            this.gridView1.Appearance.FocusedCell.ForeColor = Color.Black;
            this.gridView1.Appearance.FocusedCell.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedCell.Options.UseForeColor = true;
            this.gridView1.Appearance.FocusedRow.BackColor = Color.FromArgb(200, 0xc0, 0x9d);
            this.gridView1.Appearance.FocusedRow.BorderColor = Color.FromArgb(0xe2, 0xdb, 0xbc);
            this.gridView1.Appearance.FocusedRow.ForeColor = Color.Black;
            this.gridView1.Appearance.FocusedRow.Options.UseBackColor = true;
            this.gridView1.Appearance.FocusedRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.FocusedRow.Options.UseForeColor = true;
            this.gridView1.Appearance.FooterPanel.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.FooterPanel.BorderColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.FooterPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.FooterPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.FooterPanel.Options.UseBorderColor = true;
            this.gridView1.Appearance.FooterPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupButton.BackColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView1.Appearance.GroupButton.BorderColor = Color.FromArgb(0xd8, 0xd1, 0xb3);
            this.gridView1.Appearance.GroupButton.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupButton.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupFooter.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.GroupFooter.BorderColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.GroupFooter.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupFooter.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupFooter.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupFooter.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupPanel.BackColor = Color.FromArgb(0xf6, 0xf2, 0xd5);
            this.gridView1.Appearance.GroupPanel.BackColor2 = Color.White;
            this.gridView1.Appearance.GroupPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.GroupRow.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.GroupRow.BorderColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.GroupRow.ForeColor = Color.Black;
            this.gridView1.Appearance.GroupRow.Options.UseBackColor = true;
            this.gridView1.Appearance.GroupRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.GroupRow.Options.UseForeColor = true;
            this.gridView1.Appearance.HeaderPanel.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.HeaderPanel.BorderColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.HeaderPanel.ForeColor = Color.Black;
            this.gridView1.Appearance.HeaderPanel.Options.UseBackColor = true;
            this.gridView1.Appearance.HeaderPanel.Options.UseBorderColor = true;
            this.gridView1.Appearance.HeaderPanel.Options.UseForeColor = true;
            this.gridView1.Appearance.HideSelectionRow.BackColor = Color.FromArgb(0xed, 230, 0xcb);
            this.gridView1.Appearance.HideSelectionRow.BorderColor = Color.FromArgb(0xed, 230, 0xcb);
            this.gridView1.Appearance.HideSelectionRow.ForeColor = Color.Black;
            this.gridView1.Appearance.HideSelectionRow.Options.UseBackColor = true;
            this.gridView1.Appearance.HideSelectionRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.HideSelectionRow.Options.UseForeColor = true;
            this.gridView1.Appearance.HorzLine.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.HorzLine.Options.UseBackColor = true;
            this.gridView1.Appearance.OddRow.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.OddRow.BorderColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.OddRow.ForeColor = Color.Black;
            this.gridView1.Appearance.OddRow.Options.UseBackColor = true;
            this.gridView1.Appearance.OddRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.OddRow.Options.UseForeColor = true;
            this.gridView1.Appearance.Preview.BackColor = Color.FromArgb(0xfb, 0xfc, 0xf7);
            this.gridView1.Appearance.Preview.Font = new Font("Verdana", 7.5f);
            this.gridView1.Appearance.Preview.ForeColor = Color.FromArgb(0x94, 0x94, 0x94);
            this.gridView1.Appearance.Preview.Options.UseBackColor = true;
            this.gridView1.Appearance.Preview.Options.UseFont = true;
            this.gridView1.Appearance.Preview.Options.UseForeColor = true;
            this.gridView1.Appearance.Row.BackColor = Color.FromArgb(0xf2, 0xf4, 0xec);
            this.gridView1.Appearance.Row.ForeColor = Color.Black;
            this.gridView1.Appearance.Row.Options.UseBackColor = true;
            this.gridView1.Appearance.Row.Options.UseForeColor = true;
            this.gridView1.Appearance.RowSeparator.BackColor = Color.FromArgb(0xec, 0xe8, 0xc9);
            this.gridView1.Appearance.RowSeparator.BackColor2 = Color.White;
            this.gridView1.Appearance.RowSeparator.Options.UseBackColor = true;
            this.gridView1.Appearance.SelectedRow.BackColor = Color.FromArgb(0xdd, 0xd7, 0xbc);
            this.gridView1.Appearance.SelectedRow.BorderColor = Color.FromArgb(0xed, 230, 0xcb);
            this.gridView1.Appearance.SelectedRow.ForeColor = Color.Black;
            this.gridView1.Appearance.SelectedRow.Options.UseBackColor = true;
            this.gridView1.Appearance.SelectedRow.Options.UseBorderColor = true;
            this.gridView1.Appearance.SelectedRow.Options.UseForeColor = true;
            this.gridView1.Appearance.TopNewRow.BackColor = Color.White;
            this.gridView1.Appearance.TopNewRow.Options.UseBackColor = true;
            this.gridView1.Appearance.VertLine.BackColor = Color.FromArgb(0xd8, 0xd1, 170);
            this.gridView1.Appearance.VertLine.Options.UseBackColor = true;
            this.gridView1.Columns.AddRange(new GridColumn[] { this.gridds_ngay, this.gridds_stt, this.gridds_tenphong, this.gridds_ma, this.gridds_ten, this.gridds_id, this.gridds_gioitinh, this.gridds_namsinh, this.gridds_diachi });
            condition.Appearance.ForeColor = Color.Red;
            condition.Appearance.Options.UseForeColor = true;
            condition.Condition = FormatConditionEnum.Between;
            condition.Value1 = "0";
            condition.Value2 = "0";
            this.gridView1.FormatConditions.AddRange(new StyleFormatCondition[] { condition });
            this.gridView1.GridControl = this.gridds;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsBehavior.AllowAddRows = DefaultBoolean.True;
            this.gridView1.OptionsBehavior.AllowDeleteRows = DefaultBoolean.False;
            this.gridView1.OptionsBehavior.ReadOnly = true;
            this.gridView1.OptionsView.AutoCalcPreviewLineCount = true;
            this.gridView1.OptionsView.EnableAppearanceEvenRow = true;
            this.gridView1.OptionsView.EnableAppearanceOddRow = true;
            this.gridView1.OptionsView.ShowAutoFilterRow = true;
            this.gridView1.OptionsView.ShowFooter = true;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.gridView1.KeyDown += new KeyEventHandler(this.gridView1_KeyDown);
            this.gridView1.DoubleClick += new EventHandler(this.gridView1_DoubleClick);
            this.gridds_ngay.Caption = "Ng\x00e0y";
            this.gridds_ngay.FieldName = "ngay";
            this.gridds_ngay.Name = "gridds_ngay";
            this.gridds_ngay.OptionsColumn.AllowEdit = false;
            this.gridds_ngay.Visible = true;
            this.gridds_ngay.VisibleIndex = 0;
            this.gridds_ngay.Width = 0x66;
            this.gridds_stt.Caption = "STT";
            this.gridds_stt.FieldName = "stt";
            this.gridds_stt.Name = "gridds_stt";
            this.gridds_stt.OptionsColumn.AllowEdit = false;
            this.gridds_stt.Visible = true;
            this.gridds_stt.VisibleIndex = 1;
            this.gridds_stt.Width = 0x22;
            this.gridds_tenphong.Caption = "Khoa/Ph\x00f2ng";
            this.gridds_tenphong.FieldName = "tenphong";
            this.gridds_tenphong.Name = "gridds_tenphong";
            this.gridds_tenphong.OptionsColumn.AllowEdit = false;
            this.gridds_tenphong.Visible = true;
            this.gridds_tenphong.VisibleIndex = 2;
            this.gridds_tenphong.Width = 0x73;
            this.gridds_ma.Caption = "M\x00e3 BN";
            this.gridds_ma.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_ma.FieldName = "mabn";
            this.gridds_ma.Name = "gridds_ma";
            this.gridds_ma.OptionsColumn.AllowEdit = false;
            this.gridds_ma.Summary.AddRange(new GridSummaryItem[] { new GridColumnSummaryItem(SummaryItemType.Count, "ma", "Tổng cộng={0:n0}") });
            this.gridds_ma.Visible = true;
            this.gridds_ma.VisibleIndex = 3;
            this.gridds_ma.Width = 0x47;
            this.repositoryItemTextEdit1.AutoHeight = false;
            this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
            this.repositoryItemTextEdit1.ReadOnly = true;
            this.gridds_ten.Caption = "Họ v\x00e0 t\x00ean";
            this.gridds_ten.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_ten.FieldName = "hoten";
            this.gridds_ten.Name = "gridds_ten";
            this.gridds_ten.OptionsColumn.AllowEdit = false;
            this.gridds_ten.Visible = true;
            this.gridds_ten.VisibleIndex = 4;
            this.gridds_ten.Width = 0xef;
            this.gridds_id.Caption = "id";
            this.gridds_id.FieldName = "idql";
            this.gridds_id.Name = "gridds_id";
            this.gridds_gioitinh.Caption = "Ph\x00e1i";
            this.gridds_gioitinh.ColumnEdit = this.repositoryItemTextEdit1;
            this.gridds_gioitinh.FieldName = "tengioitinh";
            this.gridds_gioitinh.Name = "gridds_gioitinh";
            this.gridds_gioitinh.OptionsColumn.AllowEdit = false;
            this.gridds_gioitinh.Visible = true;
            this.gridds_gioitinh.VisibleIndex = 5;
            this.gridds_gioitinh.Width = 0x24;
            this.gridds_namsinh.Caption = "Năm sinh";
            this.gridds_namsinh.FieldName = "namsinh";
            this.gridds_namsinh.Name = "gridds_namsinh";
            this.gridds_namsinh.OptionsColumn.AllowEdit = false;
            this.gridds_namsinh.Visible = true;
            this.gridds_namsinh.VisibleIndex = 6;
            this.gridds_namsinh.Width = 0x2f;
            this.gridds_diachi.Caption = "Địa chỉ";
            this.gridds_diachi.FieldName = "diachi";
            this.gridds_diachi.Name = "gridds_diachi";
            this.gridds_diachi.OptionsColumn.AllowEdit = false;
            this.gridds_diachi.Visible = true;
            this.gridds_diachi.VisibleIndex = 7;
            this.gridds_diachi.Width = 0xa1;
            this.repositoryItemTextEdit2.AutoHeight = false;
            this.repositoryItemTextEdit2.DisplayFormat.FormatString = "n0";
            this.repositoryItemTextEdit2.DisplayFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit2.EditFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit2.Mask.EditMask = "n0";
            this.repositoryItemTextEdit2.Mask.MaskType = MaskType.Numeric;
            this.repositoryItemTextEdit2.Name = "repositoryItemTextEdit2";
            this.sbtntim.Appearance.Font = new Font("Tahoma", 10f);
            this.sbtntim.Appearance.Options.UseFont = true;
            this.sbtntim.Image = (Image) manager.GetObject("sbtntim.Image");
            this.sbtntim.Location = new Point(0x275, 0x1a);
            this.sbtntim.Name = "sbtntim";
            this.sbtntim.Size = new Size(0x39, 0x17);
            this.sbtntim.TabIndex = 3;
            this.sbtntim.Text = "&T\x00ecm";
            this.sbtntim.Click += new EventHandler(this.sbtntim_Click);
            this.datedenngay.EditValue = new DateTime(0x7dd, 9, 15, 2, 20, 5, 0x13f);
            this.datedenngay.Location = new Point(260, 0x1b);
            this.datedenngay.Name = "datedenngay";
            this.datedenngay.Properties.Appearance.Font = new Font("Tahoma", 10f);
            this.datedenngay.Properties.Appearance.Options.UseFont = true;
            this.datedenngay.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.datedenngay.Properties.DisplayFormat.FormatString = "dd/MM/yyyy";
            this.datedenngay.Properties.DisplayFormat.FormatType = FormatType.DateTime;
            this.datedenngay.Properties.EditFormat.FormatString = "dd/MM/yyyy";
            this.datedenngay.Properties.EditFormat.FormatType = FormatType.DateTime;
            this.datedenngay.Properties.Mask.EditMask = "dd/MM/yyyy";
            this.datedenngay.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.datedenngay.Size = new Size(0x61, 0x16);
            this.datedenngay.TabIndex = 2;
            this.label2.Font = new Font("Microsoft Sans Serif", 10f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.label2.Location = new Point(0x166, 0x1a);
            this.label2.Name = "label2";
            this.label2.Size = new Size(90, 0x17);
            this.label2.TabIndex = 2;
            this.label2.Text = "Khoa/Ph\x00f2ng:";
            this.label2.TextAlign = ContentAlignment.MiddleRight;
            this.label1.Font = new Font("Microsoft Sans Serif", 10f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.label1.Location = new Point(0xb6, 0x1a);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x51, 0x17);
            this.label1.TabIndex = 2;
            this.label1.Text = "đến ng\x00e0y:";
            this.label1.TextAlign = ContentAlignment.MiddleRight;
            this.datetungay.EditValue = new DateTime(0x7dd, 9, 15, 2, 20, 5, 0x13f);
            this.datetungay.Location = new Point(0x54, 0x1a);
            this.datetungay.Name = "datetungay";
            this.datetungay.Properties.Appearance.Font = new Font("Tahoma", 10f);
            this.datetungay.Properties.Appearance.Options.UseFont = true;
            this.datetungay.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.datetungay.Properties.DisplayFormat.FormatString = "dd/MM/yyyy";
            this.datetungay.Properties.DisplayFormat.FormatType = FormatType.DateTime;
            this.datetungay.Properties.EditFormat.FormatString = "dd/MM/yyyy";
            this.datetungay.Properties.EditFormat.FormatType = FormatType.DateTime;
            this.datetungay.Properties.Mask.EditMask = "dd/MM/yyyy";
            this.datetungay.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.datetungay.Size = new Size(0x61, 0x16);
            this.datetungay.TabIndex = 1;
            this.label12.Font = new Font("Microsoft Sans Serif", 10f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.label12.Location = new Point(6, 0x1a);
            this.label12.Name = "label12";
            this.label12.Size = new Size(0x51, 0x17);
            this.label12.TabIndex = 2;
            this.label12.Text = "Từ ng\x00e0y:";
            this.label12.TextAlign = ContentAlignment.MiddleRight;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.groupds);
            base.Name = "ucbn_dsbncho";
            base.Size = new Size(0x347, 0x1d1);
            base.Load += new EventHandler(this.ucbn_dsbncho_Load);
            this.groupds.EndInit();
            this.groupds.ResumeLayout(false);
            this.lkephong.Properties.EndInit();
            this.gridds.EndInit();
            this.gridView1.EndInit();
            this.repositoryItemTextEdit1.EndInit();
            this.repositoryItemTextEdit2.EndInit();
            this.datedenngay.Properties.VistaTimeProperties.EndInit();
            this.datedenngay.Properties.EndInit();
            this.datetungay.Properties.VistaTimeProperties.EndInit();
            this.datetungay.Properties.EndInit();
            base.ResumeLayout(false);
        }

        private void lkephong_EditValueChanged(object sender, EventArgs e)
        {
            try
            {
                CurrencyManager manager = (CurrencyManager) this.BindingContext[this.gridds.DataSource];
                DataView list = (DataView) manager.List;
                list.RowFilter = "1=1";
                if (this.lkephong.EditValue.ToString() != "0")
                {
                    list.RowFilter = "idphong=" + this.lkephong.EditValue.ToString();
                }
            }
            catch
            {
            }
        }

        private void sbtnketthuc_Click(object sender, EventArgs e)
        {
            try
            {
                XtraTabPage parent = (XtraTabPage) base.Parent;
                XtraTabControl control = (XtraTabControl) parent.Parent;
                control.TabPages.Remove(parent);
            }
            catch
            {
                XtraUserControl control2 = (XtraUserControl) base.Parent;
                control2.Controls.Remove(this);
            }
        }

        private void sbtntim_Click(object sender, EventArgs e)
        {
            if (this._iloaids == 1)
            {
                this.groupds.Text = "Danh s\x00e1ch bệnh nh\x00e2n chờ kh\x00e1m bệnh";
            }
            else
            {
                this.groupds.Text = "Danh s\x00e1ch bệnh nh\x00e2n chờ thanh to\x00e1n";
            }
            this.lkephong_EditValueChanged(null, null);
        }

        private void ucbn_dsbncho_Load(object sender, EventArgs e)
        {
            this.datetungay.EditValue = DateTime.Now;
            this.datedenngay.EditValue = DateTime.Now;
            this.sbtntim_Click(null, null);
            this.gridView1.Focus();
        }

        public long pIDQLSelected
        {
            get
            {
                return this._idql;
            }
            set
            {
                this._idql = value;
            }
        }
    }
}

